package o;

import android.app.Activity;
import android.app.Application;
import android.app.Application.ActivityLifecycleCallbacks;
import android.content.Context;
import android.os.Bundle;

public class fjh {
    private static d ˋ;

    static class d implements ActivityLifecycleCallbacks {
        private d() {
        }

        public void onActivityCreated(Activity activity, Bundle bundle) {
            if (bundle == null) {
                fji ˋ = new fjg(activity.getIntent()).ˋ();
                if (ˋ != null) {
                    String str = "startActivity";
                    if (activity.getCallingActivity() != null) {
                        str = "sendActivityResult";
                    }
                    fhz ˋ2 = fho.ˏ().ˋ(ˋ.getModule());
                    if (ˋ2 != null && ˋ2.ॱ() != null) {
                        fir o_fir = new fir(activity.getClass());
                        o_fir.ˊ(str);
                        ˋ2.ॱ().ॱ(fim.ˊ().ॱ(ˋ.getModule()).ˎ(ˋ.getPackageName()).ˎ(o_fir).ˊ());
                    }
                }
            }
        }

        public void onActivityStarted(Activity activity) {
        }

        public void onActivityResumed(Activity activity) {
        }

        public void onActivityPaused(Activity activity) {
        }

        public void onActivityStopped(Activity activity) {
        }

        public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
        }

        public void onActivityDestroyed(Activity activity) {
            if (activity.isFinishing()) {
                new fjg(activity.getIntent()).ॱ();
            }
        }
    }

    public static synchronized void ॱ(Context context) {
        synchronized (fjh.class) {
            if (ˋ == null) {
                ˋ = new d();
                ((Application) context.getApplicationContext()).registerActivityLifecycleCallbacks(ˋ);
            }
        }
    }
}
